package com.tusuo.stds.di;

import android.app.Application;

import com.tusuo.stds.DaggerMyAppComponent;
import com.tusuo.stds.MyAppComponent;
import com.tusuo.stds.di.module.AppModule;
import com.tusuo.stds.ui.account.AccountPresenterComponent;
import com.tusuo.stds.ui.account.DaggerAccountPresenterComponent;
import com.tusuo.stds.ui.ad.AdActivityComponent;
import com.tusuo.stds.ui.ad.DaggerAdActivityComponent;
import com.tusuo.stds.ui.avatar.AvatarPresenterComponent;
import com.tusuo.stds.ui.avatar.DaggerAvatarPresenterComponent;
import com.tusuo.stds.ui.bindthird.BindThirdPresenterComponent;
import com.tusuo.stds.ui.bindthird.DaggerBindThirdPresenterComponent;
import com.tusuo.stds.ui.complete.CompleteQuestionPresenterComponent;
import com.tusuo.stds.ui.complete.CompleteResultPresenterComponent;
import com.tusuo.stds.ui.complete.DaggerCompleteQuestionPresenterComponent;
import com.tusuo.stds.ui.complete.DaggerCompleteResultPresenterComponent;
import com.tusuo.stds.ui.integrity.DaggerIntegrityDetailActivityComponent;
import com.tusuo.stds.ui.integrity.DaggerIntegrityFragmentComponent;
import com.tusuo.stds.ui.integrity.IntegrityDetailActivityComponent;
import com.tusuo.stds.ui.integrity.IntegrityFragmentComponent;
import com.tusuo.stds.ui.lab.DaggerLabPresenterComponent;
import com.tusuo.stds.ui.lab.LabPresenterComponent;
import com.tusuo.stds.ui.main.DaggerFindFragmentComponent;
import com.tusuo.stds.ui.main.FindFragmentComponent;
import com.tusuo.stds.ui.mobilenum.DaggerSetMobileNumPresenterComponent;
import com.tusuo.stds.ui.mobilenum.SetMobileNumPresenterComponent;
import com.tusuo.stds.ui.password.DaggerPasswordPresenterComponent;
import com.tusuo.stds.ui.password.PasswordPresenterComponent;
import com.tusuo.stds.ui.pay.DaggerMyPayPresenterComponent;
import com.tusuo.stds.ui.pay.MyPayPresenterComponent;
import com.tusuo.stds.ui.question.DaggerLevelRecordDetailPresenterComponent;
import com.tusuo.stds.ui.question.LevelRecordDetailPresenterComponent;
import com.tusuo.stds.ui.questionbank.DaggerQuestionBankTempPresenterComponent;
import com.tusuo.stds.ui.bindnew.BindNewPresenterComponent;
import com.tusuo.stds.ui.bindnew.DaggerBindNewPresenterComponent;
import com.tusuo.stds.ui.gender.DaggerSetGenderPresenterComponent;
import com.tusuo.stds.ui.gender.SetGenderPresenterComponent;
import com.tusuo.stds.ui.level.DaggerLevelPresenterComponent;
import com.tusuo.stds.ui.level.DaggerLevelRecordPresenterComponent;
import com.tusuo.stds.ui.level.DaggerLevelResultPresenterComponent;
import com.tusuo.stds.ui.level.LevelPresenterComponent;
import com.tusuo.stds.ui.level.LevelRecordPresenterComponent;
import com.tusuo.stds.ui.level.LevelResultPresenterComponent;
import com.tusuo.stds.ui.linkaccount.DaggerLinkAccountPresenterComponent;
import com.tusuo.stds.ui.linkaccount.LinkAccountPresenterComponent;
import com.tusuo.stds.ui.login.DaggerLoginPresenterComponent;
import com.tusuo.stds.ui.login.LoginPresenterComponent;
import com.tusuo.stds.ui.main.ChallengeFragmentComponent;
import com.tusuo.stds.ui.main.DaggerChallengeFragmentComponent;
import com.tusuo.stds.ui.main.DaggerMainActivityComponent;
import com.tusuo.stds.ui.main.DaggerMeFragmentComponent;
import com.tusuo.stds.ui.main.DaggerQuestionBankFragmentComponent;
import com.tusuo.stds.ui.main.MainActivityComponent;
import com.tusuo.stds.ui.main.MeFragmentComponent;
import com.tusuo.stds.ui.main.QuestionBankFragmentComponent;
import com.tusuo.stds.ui.module.DaggerModulePresenterComponent;
import com.tusuo.stds.ui.module.ModulePresenterComponent;
import com.tusuo.stds.ui.name.DaggerSetNamePresenterComponent;
import com.tusuo.stds.ui.name.SetNamePresenterComponent;
import com.tusuo.stds.ui.question.DaggerQuestionPresenterComponent;
import com.tusuo.stds.ui.question.QuestionPresenterComponent;
import com.tusuo.stds.ui.questionbank.QuestionBankTempPresenterComponent;
import com.tusuo.stds.ui.rank.DaggerRankPresenterComponent;
import com.tusuo.stds.ui.rank.RankPresenterComponent;
import com.tusuo.stds.ui.register.DaggerRegisterPresenterComponent;
import com.tusuo.stds.ui.register.RegisterPresenterComponent;
import com.tusuo.stds.ui.resetpassword.DaggerResetPasswordPresenterComponent;
import com.tusuo.stds.ui.resetpassword.ResetPasswordPresenterComponent;
import com.tusuo.stds.ui.scene.DaggerSceneActivityComponent;
import com.tusuo.stds.ui.scene.DaggerSceneFragmentComponent;
import com.tusuo.stds.ui.scene.DaggerScenePresenterComponent;
import com.tusuo.stds.ui.scene.SceneActivityComponent;
import com.tusuo.stds.ui.scene.SceneFragmentComponent;
import com.tusuo.stds.ui.scene.ScenePresenterComponent;
import com.tusuo.stds.ui.scenedetail.DaggerLevelDetailActivityComponent;
import com.tusuo.stds.ui.scenedetail.DaggerSceneDetailPresenterComponent;
import com.tusuo.stds.ui.scenedetail.LevelDetailActivityComponent;
import com.tusuo.stds.ui.scenedetail.SceneDetailPresenterComponent;
import com.tusuo.stds.ui.scenesearch.DaggerSceneSearchPresenterComponent;
import com.tusuo.stds.ui.scenesearch.SceneSearchPresenterComponent;
import com.tusuo.stds.ui.scenesetting.DaggerLockFragmentComponent;
import com.tusuo.stds.ui.scenesetting.DaggerNewOnlineActivityComponent;
import com.tusuo.stds.ui.scenesetting.DaggerSceneSettingPresenterComponent;
import com.tusuo.stds.ui.scenesetting.DaggerUnLockFragmentComponent;
import com.tusuo.stds.ui.scenesetting.LockFragmentComponent;
import com.tusuo.stds.ui.scenesetting.NewOnlineActivityComponent;
import com.tusuo.stds.ui.scenesetting.SceneSettingPresenterComponent;
import com.tusuo.stds.ui.scenesetting.UnLockFragmentComponent;
import com.tusuo.stds.ui.school.DaggerProvincePresenterComponent;
import com.tusuo.stds.ui.school.DaggerSchoolPresenterComponent;
import com.tusuo.stds.ui.school.ProvincePresenterComponent;
import com.tusuo.stds.ui.school.SchoolPresenterComponent;
import com.tusuo.stds.ui.settings.DaggerSettingsPresenterComponent;
import com.tusuo.stds.ui.settings.SettingsPresenterComponent;
import com.tusuo.stds.ui.similarity.DaggerSimilarityResultPresenterComponent;
import com.tusuo.stds.ui.similarity.DaggerSimilarityTempPresenterComponent;
import com.tusuo.stds.ui.similarity.SimilarityResultPresenterComponent;
import com.tusuo.stds.ui.similarity.SimilarityTempPresenterComponent;
import com.tusuo.stds.ui.splash.DaggerSplashActivityComponent;
import com.tusuo.stds.ui.splash.SplashActivityComponent;
import com.tusuo.stds.ui.suggest.DaggerSuggestPresenterComponent;
import com.tusuo.stds.ui.suggest.SuggestPresenterComponent;
import com.tusuo.stds.ui.vip.DaggerPrivilegeActivityComponent;
import com.tusuo.stds.ui.vip.DaggerVipPresenterComponent;
import com.tusuo.stds.ui.vip.PrivilegeActivityComponent;
import com.tusuo.stds.ui.vip.VipPresenterComponent;

/**
 * @author J.Huang
 * @version 1.0
 */
public class Injector {

    private static MyAppComponent mAppComponent = null;

    private Injector() {}

    public static MyAppComponent initMyAppComponent(Application app) {
        mAppComponent = null;
        mAppComponent = DaggerMyAppComponent.builder()
                .appModule(new AppModule(app))
                .build();
        return mAppComponent;
    }

//    public static MyAppComponent getAppComponent() {
//        return mAppComponent;
//    }

    public static SplashActivityComponent initSplashActivityComponent() {
        SplashActivityComponent component = null;
        if (mAppComponent != null) {
            component = DaggerSplashActivityComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static NewOnlineActivityComponent initNewOnlineActivityComponent() {
        NewOnlineActivityComponent component = null;
        if (mAppComponent != null) {
            component = DaggerNewOnlineActivityComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static RegisterPresenterComponent initRegisterPresenterComponent() {
        RegisterPresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerRegisterPresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static LoginPresenterComponent initLoginPresenterComponent() {
        LoginPresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerLoginPresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static ResetPasswordPresenterComponent initResetPasswordPresenterComponent() {
        ResetPasswordPresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerResetPasswordPresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static MainActivityComponent initMainActivityComponent() {
        MainActivityComponent component = null;
        if (mAppComponent != null) {
            component = DaggerMainActivityComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static ChallengeFragmentComponent initChallengeFragmentComponent() {
        ChallengeFragmentComponent component = null;
        if (mAppComponent != null) {
            component = DaggerChallengeFragmentComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static QuestionBankFragmentComponent initQuestionBankFragmentComponent() {
        QuestionBankFragmentComponent component = null;
        if (mAppComponent != null) {
            component = DaggerQuestionBankFragmentComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static MeFragmentComponent initMeFragmentComponent() {
        MeFragmentComponent component = null;
        if (mAppComponent != null) {
            component = DaggerMeFragmentComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static FindFragmentComponent initFindFragmentComponent() {
        FindFragmentComponent component = null;
        if (mAppComponent != null) {
            component = DaggerFindFragmentComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }


    public static IntegrityFragmentComponent initIntegrityFragmentComponent() {
        IntegrityFragmentComponent component = null;
        if (mAppComponent != null) {
            component = DaggerIntegrityFragmentComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }


    public static SetNamePresenterComponent initSetNamePresenterComponent() {
        SetNamePresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerSetNamePresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static SetGenderPresenterComponent initSetGenderPresenterComponent() {
        SetGenderPresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerSetGenderPresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static SettingsPresenterComponent initSettingsPresenterComponent() {
        SettingsPresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerSettingsPresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static LevelRecordPresenterComponent initLevelRecordPresenterComponent() {
        LevelRecordPresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerLevelRecordPresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static SceneActivityComponent initSceneActivityComponent() {
        SceneActivityComponent component = null;
        if (mAppComponent != null) {
            component = DaggerSceneActivityComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }


    public static ScenePresenterComponent initScenePresenterComponent() {
        ScenePresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerScenePresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static SceneSettingPresenterComponent initSceneSettingPresenterComponent() {
        SceneSettingPresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerSceneSettingPresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static SceneDetailPresenterComponent initSceneDetailPresenterComponent() {
        SceneDetailPresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerSceneDetailPresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static SceneSearchPresenterComponent initSceneSearchPresenterComponent() {
        SceneSearchPresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerSceneSearchPresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }


    public static RankPresenterComponent initRankPresenterComponent() {
        RankPresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerRankPresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static ModulePresenterComponent initModulePresenterComponent() {
        ModulePresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerModulePresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static LevelPresenterComponent initLevelPresenterComponent() {
        LevelPresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerLevelPresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static QuestionPresenterComponent initQuestionPresenterComponent() {
        QuestionPresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerQuestionPresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static LevelResultPresenterComponent initLevelResultPresenterComponent() {
        LevelResultPresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerLevelResultPresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static LinkAccountPresenterComponent initLinkAccountPresenterComponent() {
        LinkAccountPresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerLinkAccountPresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static BindNewPresenterComponent initBindNewPresenterComponent() {
        BindNewPresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerBindNewPresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static LevelRecordDetailPresenterComponent initLevelRecordDetailPresenterComponent() {
        LevelRecordDetailPresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerLevelRecordDetailPresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }


    public static QuestionBankTempPresenterComponent initQuestionBankTempPresenterComponent() {
        QuestionBankTempPresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerQuestionBankTempPresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static AvatarPresenterComponent initAvatarPresenterComponent() {
        AvatarPresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerAvatarPresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static AdActivityComponent initAdActivityComponent() {
        AdActivityComponent component = null;
        if (mAppComponent != null) {
            component = DaggerAdActivityComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static SetMobileNumPresenterComponent initSetMobileNumPresenterComponent() {
        SetMobileNumPresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerSetMobileNumPresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static ProvincePresenterComponent initProvincePresenterComponent() {
        ProvincePresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerProvincePresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static SchoolPresenterComponent initSchoolPresenterComponent() {
        SchoolPresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerSchoolPresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static AccountPresenterComponent initAccountPresenterComponent() {
        AccountPresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerAccountPresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static LabPresenterComponent initLabPresenterComponent() {
        LabPresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerLabPresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static BindThirdPresenterComponent initBindThirdPresenterComponent() {
        BindThirdPresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerBindThirdPresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static SimilarityTempPresenterComponent initSimilarityTempPresenterComponent() {
        SimilarityTempPresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerSimilarityTempPresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static SimilarityResultPresenterComponent initSimilarityResultPresenterComponent() {
        SimilarityResultPresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerSimilarityResultPresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static CompleteResultPresenterComponent initCompleteResultPresenterComponent() {
        CompleteResultPresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerCompleteResultPresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static MyPayPresenterComponent initMyPayPresenterComponent() {
        MyPayPresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerMyPayPresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static SuggestPresenterComponent initSuggestPresenterComponent() {
        SuggestPresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerSuggestPresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static VipPresenterComponent initVipPresenterComponent() {
        VipPresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerVipPresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static PasswordPresenterComponent initPasswordPresenterComponent() {
        PasswordPresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerPasswordPresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static CompleteQuestionPresenterComponent initCompleteQuestionPresenterComponent() {
        CompleteQuestionPresenterComponent component = null;
        if (mAppComponent != null) {
            component = DaggerCompleteQuestionPresenterComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static UnLockFragmentComponent initUnLockFragmentComponent() {
        UnLockFragmentComponent component = null;
        if (mAppComponent != null) {
            component = DaggerUnLockFragmentComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static SceneFragmentComponent initSceneFragmentComponent() {
        SceneFragmentComponent component = null;
        if (mAppComponent != null) {
            component = DaggerSceneFragmentComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static LockFragmentComponent initLockFragmentComponent() {
        LockFragmentComponent component = null;
        if (mAppComponent != null) {
            component = DaggerLockFragmentComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static IntegrityDetailActivityComponent initIntegrityDetailActivityComponent() {
        IntegrityDetailActivityComponent component = null;
        if (mAppComponent != null) {
            component = DaggerIntegrityDetailActivityComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static PrivilegeActivityComponent initPrivilegeActivityComponent() {
        PrivilegeActivityComponent component = null;
        if (mAppComponent != null) {
            component = DaggerPrivilegeActivityComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }

    public static LevelDetailActivityComponent initLevelDetailActivityComponent() {
        LevelDetailActivityComponent component = null;
        if (mAppComponent != null) {
            component = DaggerLevelDetailActivityComponent.builder()
                    .myAppComponent(mAppComponent)
                    .build();
        }
        return component;
    }
}
